<script type="text/javascript">
$(function () {
	var url = '${contextPath}script/sys/message.js';
	$.ajax({url:url, dataType:'script', cache:true,
		success: function(){
			var page = sys_fill_parm('sendMessageForm');
			queryMessage_message(page);
		}
	});
	
	$('#editMessageDiv').tabs();
	$('#sendMessageForm').find("input:checkbox, input:radio").not('input.ibtn').uniform();

});
</script>

<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte>

<div id="editMessageDiv">
	<div class="tab_menu">
          	<ul class="tabLeft">
          		<li><a href="#tabs-1" onclick="javascript: $('#message_type').val('1'); queryMessage_message();">收件箱</a></li>
				<li><a href="#tabs-2" onclick="javascript: $('#message_type').val('2'); queryMessage_message();">发件箱</a></li>
				<li><a href="#tabs-3" onclick="javascript: $('#message_type').val('3'); queryMessage_message();">回收站</a></li>
			</ul>
	</div>
	<div id="tabs-1">
			<form id="sendMessageForm">
				<input type="hidden" id="message_type" name="type" value="1" />
				<input type="hidden" id="uc" name="uc" value="${cu_code}" />
				<table class="search_term_table">
					<tr>
						<th style="width:50px;">标题</th>
						<td style="width:200px;"><input type="text" name="title" style="width:150px;" /></td>
						<th style="width:80px;">发送时间</th>
						<td style="width:260px;">从 <input type="text" id="start" name="start" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/> 到 <input type="text" id="end" name="end" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" /></td>
						<th style="width: 60px;"><input type="checkbox" name="iv" value="1" onclick="javascript:queryMessage_message();" checked /> 未读</th>
							<td style="width: 100px;"></td>
						<td style="text-align: right;">
							<a href="javascript:;" class="btn btn-info" onclick="javascript: $('#message_type').val('1'); queryMessage_message();">
								<i class="fontello-icon-search-5"></i>&nbsp;查&nbsp;&nbsp;询&nbsp;
							</a>
						</td>
					</tr>
				</table>
			</form>
		<div id="sendResultList"></div>
	</div>
	<div class="hide" id="tabs-2">
		<form id="replyMessageForm">
			<input type="hidden" id="type" name="type" value="2" />
			<table class="search_term_table">
				<tr>
					<th style="width:50px;">标题</th>
					<td style="width:200px;"><input type="text" name="title" style="width:150px;" /></td>
					<th style="width:80px;">发送时间</th>
					<td style="width:260px;">从 <input type="text" id="start" name="start" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/> 到 <input type="text" id="end" name="end" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/></td>
					<td style="text-align: right;">
						<a href="javascript:;" class="btn btn-info" onclick="javascript: $('#message_type').val('2'); queryMessage_message();">
							<i class="fontello-icon-search-5"></i>&nbsp;查&nbsp;&nbsp;询&nbsp;
						</a>&nbsp;&nbsp;
						<a href="javascript:;" class="btn btn-info" onclick="javascript: sys_load_handle('message-edit');">
							<i class="fontello-icon-publish"></i>&nbsp;写邮件&nbsp;
						</a>
					</td>
				</tr>
			</table>
		</form>
		<div id="replyResultList"></div>
	</div>
	<div class="hide" id="tabs-3">
		<form id="trashMessageForm">
			<input type="hidden" id="type" name="type" value="3" />
			<table class="search_term_table">
				<tr>
					<th style="width:50px;">标题</th>
					<td style="width:200px;"><input type="text" name="title" style="width:150px;" /></td>
					<th style="width:80px;">发送时间</th>
					<td style="width:260px;">从 <input type="text" id="start" name="start" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/> 到 <input type="text" id="end" name="end" style="width:65px;" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"/></td>
					<td style="text-align: right;">
						<a href="javascript:;" class="btn btn-info" onclick="javascript: $('#message_type').val('3'); queryMessage_message();">
							<i class="fontello-icon-search-5"></i>&nbsp;查&nbsp;&nbsp;询&nbsp;
						</a>
					</td>
				</tr>
			</table>
		</form>
		<div id="trashResultList"></div>
	</div>
</div>
